from library_test.base_test import BaseTest
from ascend_deployer.ascend_deployer import CLI


class BaseTestCLI(BaseTest):

    @classmethod
    def setUpClass(cls) -> None:
        super().setUpClass()

    def setUp(self) -> None:
        self.cli = CLI(
        "ascend-deployer",
        "Manage Ascend Packages and dependence packages for specified OS"
        )

class TestCLI(BaseTestCLI):

    def test_check_ai_frameworks(self):
        self.cli.install = ["tensorflow", "pytorch", "mindspore"]
        self.assertEqual(False, self.cli._check_ai_frameworks())
        self.cli.install = ["tensorflow", "pytorch"]
        self.assertEqual(False, self.cli._check_ai_frameworks())
        self.cli.install = ["tensorflow"]
        self.assertEqual(True, self.cli._check_ai_frameworks())
        self.cli.install = ["mindie"]
        self.assertEqual(True, self.cli._check_ai_frameworks())
        self.cli.install = None
        self.assertEqual(True, self.cli._check_ai_frameworks())

